import request from '@/utils/request'

// 查询砍价商品列表
export function listKanjiaGoods(query) {
  return request({
    url: '/manager/promotion/kanJiaGoods/list',
    method: 'get',
    params: query
  })
}

// 查询商城砍价商品详细
export function getKanjiaGoods(id) {
  return request({
    url: '/manager/promotion/kanJiaGoods/' + id,
    method: 'get'
  })
}

// 新增砍价活动商品
export function addKanjiaGoods(data) {
  return request({
    url: '/manager/promotion/kanJiaGoods',
    method: 'post',
    data: data
  })
}

// 修改砍价活动商品
export function updateKanjiaGoods(data) {
  return request({
    url: '/manager/promotion/kanJiaGoods',
    method: 'put',
    data: data
  })
}

// 删除砍价活动商品
export function delKanjiaGoods(id) {
  return request({
    url: '/manager/promotion/kanJiaGoods/' + id,
    method: 'delete'
  })
}

// 启用商城砍价活动商品
export function enableKanjiaGoods(id) {
  return request({
    url: '/manager/promotion/kanJiaGoods/enable/' + id,
    method: 'post'
  })
}

// 关闭商城优惠券
export function closeFullDiscount(ids) {
  return request({
    url: '/manager/promotion/fullDiscount/close/' + ids,
    method: 'post'
  })
}
